package NiuKe.JianZhiOffer;

import java.util.*;

public class Test {
    public static void main(String[] args) {
        /*Stack<Integer> stack = new Stack<>();
        stack.push(5);
        stack.push(2);
        stack.push(2);
        stack.push(2);
        System.out.println(stack.lastElement());
        System.out.println(stack.peek());
        System.out.println(stack.size());*/

      /*  Queue<Integer> queue = new LinkedList<>();
        queue.add(5);
        queue.add(2);
        queue.add(9);
        queue.add(52);
        queue.add(8);
        queue.add(58);
        queue.add(3);
        queue.add(12);
        System.out.println(queue.peek());
        System.out.println(queue.poll());
        System.out.println(queue.peek());
        System.out.println(queue.remove());
        System.out.println(queue.peek());
        Queue<Integer> que = new LinkedList<>();


        System.out.println(queue);
        que.add(56);
        System.out.println(que);
        System.out.println(queue);*/

        List<Integer> list = new LinkedList<Integer>();
        ArrayList list1 = new ArrayList();
        list1.add(5);
        list1.add(525);
        list1.add(52);
        list1.add(89);
        list1.add(898);

        list1.add(5);
        list1.add(500);

        ArrayList list2 = (ArrayList) list1.clone();
        list2.add(88888);
        list2.add(9999999);
        System.out.println(list1);
        System.out.println(list2);
        list1.clear();
        System.out.println(list1);





    }
}
